from wish.pool.role_pool import RolePool
from wish.pool.weapon_pool import WeaponPool


def get_case(times):
    role_count = 0
    weapon_count = 0
    role_pool = RolePool()
    weapon_pool = WeaponPool()

    i = 0
    while i < times:
        i += 1
        if role_count < 7:
            role_res = role_pool.next()
            if role_res == RolePool.ROLE_5_UP:
                role_count += 1
        else:
            weapon_res = weapon_pool.next()
            if weapon_res == WeaponPool.WEAPON_5_NEED:
                weapon_count += 1
    return parse_case(role_count, weapon_count)


def parse_case(role_count, weapon_count):
    return role_count * 100 + weapon_count, '%d角色%d武器' % (role_count, weapon_count)
